package com.yfqy.app.domain.mapper;

import com.yfqy.app.domain.entity.Promotion;
import com.yfqy.app.modules.promotion.dto.PromotionQueryDTO;
import com.yfqy.app.modules.promotion.vo.PromotionVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PromotionMapper {

    int insert(Promotion record);

    Promotion selectByPrimaryKey(Long id);

    int updatePromotionWithStatus(@Param("record") Promotion record, @Param("currStatus") Byte currStatus);

    List<PromotionVO> queryPromotionPage(@Param("queryDTO") PromotionQueryDTO queryDTO);


    int endPromotionBySpuId(@Param("spuId") Long spuId, @Param("currentUserId") Long currentUserId);

    PromotionVO selectById(@Param("id") Long id);

    List<Promotion> selectPromotionsToStart();

    int updateStatusById(@Param("id") Long id, @Param("targetStatus") int status, @Param("currStatus") int currStatus);

    List<Promotion> selectPromotionsToEnd();

    int endPromotion(@Param("updatePromotion") Promotion updatePromotion);

    int startPromotion(@Param("updatePromotion") Promotion updatePromotion);
}